#include <System.cpu\cpuFalloc.h>
#include <System\Scheduler\SliceCollection.hpp>
#include <stdio.h>
using namespace System::Scheduler;

int TreeSet_COMPARE(unsigned __int32 shard, void* x, void* y)
{
	int a = *((int*)x);
	int b = *((int*)y);
    return (a < b ? -1 : (a > b ? 1 : 0));
}

class MyElement : public System::Scheduler::Element
{
public:
	int A;

};

void testScheduler(fallocHeap* heap)
{
	fallocInit(heap);

	MyElement e; e.ScheduleStyle = Multiple; e.A = 5;

	SliceCollection s; s.xtor(heap);
	s.Schedule(&e, 10);
	s.MoveNextSlice();
	s.Dispose();
}

void main()
{
	cpuFallocHost fallocHost = cpuFallocInit();

	testScheduler(fallocHost.heap);

	// free and exit
	cpuFallocEnd(fallocHost);
	printf("done."); char c; scanf_s("%c", &c);
}
